package com.example.hanchen.yongkanggy.home.activity;

import android.os.Bundle;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.example.hanchen.yongkanggy.BR;
import com.example.hanchen.yongkanggy.R;
import com.example.hanchen.yongkanggy.databinding.ActivityLatestNewsBinding;
import com.example.hanchen.yongkanggy.databinding.ActivityMainBinding;
import com.example.hanchen.yongkanggy.home.adapter.HomeAdapter;
import com.example.hanchen.yongkanggy.home.base.StatusBarDatabindingActivity;
import com.example.hanchen.yongkanggy.home.viewmodel.HomeViewModel;

import java.util.ArrayList;
import java.util.List;

/*
* 最新消息主界面
* */

public class LatestNewsActivity extends StatusBarDatabindingActivity<ActivityLatestNewsBinding, HomeViewModel> {
    HomeAdapter homeAdapter;
    List<String> stringList = new ArrayList<>();

    @Override
    protected int initLayoutID(Bundle savedInstanceState) {
        return R.layout.activity_latest_news;
    }

    @Override
    public int initVariableId() {
        return BR.LatestNewsModel;
    }

    @Override
    protected void initView() {
        for (int i = 0; i < 8; i++) {
            stringList.add("");
        }

        homeAdapter = new HomeAdapter(this, new HomeAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(int position) {
                startActivity(new android.content.Intent(LatestNewsActivity.this, InspectionDetailsActivity.class));
            }
        });

        mDatabinding.rvList.setLayoutManager(new LinearLayoutManager(this));
        mDatabinding.rvList.setAdapter(homeAdapter);
        homeAdapter.setTabData(stringList);


        mDatabinding.tvTitle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void initData() {


    }
}